package jnBase.components
{
	import laya.events.Event;
	import laya.utils.Handler;
	
	import ui.tools.MyDialogUI;
	
	public class Dlg_XunWen extends MyDialogUI
	{
		private var _msg:String;
		private var _yes:String;
		private var _no:String;
		private var _title:String;
		private var _yesFun:Handler;
		private var _noFun:Handler;
		
		public function Dlg_XunWen($msg:String,$yes:String="确认",$yesFun:Handler=null,$no:String="取消",$noFun:Handler=null,$title:String="提示信息")
		{
			super();
			size(430,305);
			_msg=$msg;
			_yes=$yes;
			_no=$no;
			_yesFun=$yesFun;
			_noFun=$noFun;
			_title=$title;
		}
		
		override public function onAwake():void
		{
			// TODO Auto Generated method stub
			super.onAwake();
			txt_msg.text=_msg;
			txt_title.text=_title;
			btn_ok.label=_yes;
			btn_cancle.label=_no;
			if(_yesFun) btn_ok.on(Event.CLICK,_yesFun.caller,_yesFun.method);
			if(_noFun) btn_cancle.on(Event.CLICK,_noFun.caller,_noFun.method);
			else btn_cancle.on(Event.CLICK,this,function():void{
				this.close();
			});
		}
		
		override public function onClosed(type:String=null):void
		{
			// TODO Auto Generated method stub
			super.onClosed(type);
			this.destroy();
		}
		
		
	}
}